<!--
 * @Author: ZhaoZhiqi
 * @Date: 2022-09-01 14:32:57
 * @LastEditors: ZhaoZhiqi
 * @LastEditTime: 2022-11-18 14:41:49
 * @Description: webview
 * @FilePath: \tuanfeng-mini\src\pages\webview.vue
-->
<template>
    <div>
        <web-view :src="src"></web-view>
    </div>
</template>
<script>
export default {
    data() {
        return {
            src: "",
            title: "",
            urlParamStr: "", // webview路径的参数字符串
        };
    },
    onShareAppMessage() {},
    onLoad(options) {
        console.log(options);

        this.url = options.url;
        this.title = options.title;
        this.urlParamStr = options.urlParamStr
            ? options.urlParamStr.replaceAll("|", "&").replaceAll(":", "=")
            : "";

        this.src = this.urlParamStr
            ? this.url + "?" + this.urlParamStr
            : this.url;

        console.log(this.src);

        if (this.title) {
            wx.setNavigationBarTitle({
                title: this.title,
            });
        }
    },
};
</script>
<style scoped lang="scss">
</style>
